package com.stnet.entity;

/**
 * UsersRolesId entity.
 * 
 * @author MyEclipse Persistence Tools
 */

public class UsersRolesId implements java.io.Serializable {

	// Fields

	private Users users;
	private Roles roles;

	// Constructors

	/** default constructor */
	public UsersRolesId() {
	}

	/** full constructor */
	public UsersRolesId(Users users, Roles roles) {
		this.users = users;
		this.roles = roles;
	}

	// Property accessors

	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	public Roles getRoles() {
		return this.roles;
	}

	public void setRoles(Roles roles) {
		this.roles = roles;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UsersRolesId))
			return false;
		UsersRolesId castOther = (UsersRolesId) other;

		return ((this.getUsers() == castOther.getUsers()) || (this.getUsers() != null
				&& castOther.getUsers() != null && this.getUsers().equals(
				castOther.getUsers())))
				&& ((this.getRoles() == castOther.getRoles()) || (this
						.getRoles() != null
						&& castOther.getRoles() != null && this.getRoles()
						.equals(castOther.getRoles())));
	}
	
	/**
	 * 2012-02-03 21:54:50,665 [http-8080-5] ERROR org.hibernate.LazyInitializationException - illegal access to loading collection
		org.hibernate.LazyInitializationException: illegal access to loading collection
	 * */
    /**
	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUsers() == null ? 0 : this.getUsers().hashCode());
		result = 37 * result
				+ (getRoles() == null ? 0 : this.getRoles().hashCode());
		return result;
	}
	*/

}